
var Mock = require('mockjs')

//用户信息
module.exports = (req, res) => {
	let user = 'huanghuisong'
	let pass = '123456'
  //console.log(req.query) //前端传来胡数据在里面，这里获取即可
		//query(get)、body(post) = 前端请求传入的参数
		let {id=0}=req.query;
		  console.log(req.query)
	  var data = {
		body: req.body,
		query: req.query,
		userName: req.query.userName,
	  	passWord: req.query.passWord,
	  	code:0,
	  	test:1,
	  	message:"ok",
	    // 属性 list 的值是一个数组，其中含有 1 到 10 个元素
		};

		if(user != req.query.userName || pass != req.query.passWord){
			data.message = '登入失败'
			data.code = -101
		}else{
			data.message = '登入成功'
		}
	  res.jsonp(Mock.mock(data))
};
